﻿using System;
using System.Data;
using System.IO;

namespace KvDbApi
{
    public interface IValueHandle
    {
        string Key { get; }

        ValueState LastKnownState { get; }

        DateTimeOffset? NextExpiry { get; }

        TimeSpan TimeToLive { get; set; }

        bool HardenToDisk { get; set; }

        int? Version { get; set; }

        int Touch(IDbConnection connection, TimeSpan? newTimeToLive = null);

        int Move(IDbConnection connection, TimeSpan? newTimeToLive = null);
        
        int Delete(IDbConnection connection, bool destroy);
        
        Stream GetReaderStream(IDbConnection connection);

        Stream GetWriterStream(IDbConnection connection);
    }
}
